<?php
/**
 * Base controller class
 * @author tomasz.suchanek
 * @since 0.6
 * @package Yum.core
 *
 */
abstract class YumController extends CController
{
	/**
	 * @var array
	 */
	public $breadcrumbs;
	
	/**
	 * @var array
	 */
	public $menu;
	
	/**
	 * @var string
	 */
	public $title='Change me!';
 	
	//function for multi language
	public function init(){
		parent::init();
        $app = Yii::app();
        if (isset($_POST['language'])){
            $app->language = $_POST['language'];
            $app->session['_lang'] = $app->language;
        }
        else if (isset($app->session['_lang'])){
            $app->language = $app->session['_lang'];
        }
        else {
        	$app->language = 'ja';
        }
		//$this->file = Yii::app()->file;
	}
	
	/**
	 * Filters aplied to all Yum controllers
	 * @return array
	 */
	public function filters()
	{
		return array(
			'accessControl',
		);
	}	
	
}
?>
